# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=hexter
pkgver=1.1.1
pkgrel=2
pkgdesc="A Yamaha DX7 modeling software synthesizer for the DSSI Soft Synth Interface"
arch=(loong64 x86_64)
url="https://github.com/smbolton/hexter"
license=(GPL2)
groups=(
  dssi-plugins
  pro-audio
)
depends=(
  cairo
  dssi-host
  glibc
)
makedepends=(
  alsa-lib
  dssi
  glib2
  gtk2
  ladspa
  liblo
  pango
)
source=($url/archive/version_$pkgver/$pkgname-version_$pkgver.tar.gz)
sha512sums=('3de1e75df453a79d4b7eda4cf503f436201db34837b7584ea683f57c4b62029ea994eb6bc6d461e10938183b995792ded975ac112f0b9639d06b5571c93f3100')
b2sums=('32bcb1f42f9971fd4ca2406e58b7a9f735510eaad5ccc92a0aa45200c0ca468fb02698d1e548f9a6a657bbae183eabe20a200352470270042ec7b99f0238b1db')

prepare() {
  cd $pkgname-version_$pkgver
  ./autogen.sh
}

build() {
  cd $pkgname-version_$pkgver
  ./configure --prefix=/usr
  # prevent excessive overlinking due to libtool
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  make -k check -C $pkgname-version_$pkgver
}

package() {
  depends+=(
    alsa-lib libasound.so
    gtk2 libgdk-x11-2.0.so libgtk-x11-2.0.so 
    glib2 libglib-2.0.so libgobject-2.0.so
    liblo liblo.so
    pango libpango-1.0.so libpangocairo-1.0.so
  )

  make DESTDIR="$pkgdir/" install -C $pkgname-version_$pkgver
}
